package com.xyrl.project.common.csr.vo;

import com.fasterxml.jackson.annotation.JsonFilter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.xyrl.project.common.common.vo.AppConfigVo;
import com.xyrl.project.common.csr.enu.CsrUserType;
import com.xyrl.project.common.store.enu.StoreStatus;
import com.xyrl.project.common.store.enu.StoreStatusNode;
import com.xyrl.project.common.store.enu.StoreType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 客户返回结果
 *
 * @author zhongp
 * @version 1.0
 * @className CsrUserVo
 * @company 星纭融链科技服务有限公司
 * @date 2020-01-02 13:55:14
 * @Description
 */
@Data
@JsonIgnoreProperties(ignoreUnknown = true, value = {"salt","tradePwd"})
public class CsrUserVo {
    /**
     * 客户id
     */
    private Long id;

    @ApiModelProperty(value = "手机号")
    @Length(min = 1, max = 16, message = "手机号必须在{min}~{max}字符之间")
    private String mobile;

    @ApiModelProperty(value = "姓名")
    @Length(min = 1, max = 24, message = "姓名必须在{min}~{max}字符之间")
    private String name;

    @ApiModelProperty(value = "商户用户类型")
    @NotNull
    private CsrUserType userType;

    @JsonFilter("salt")
    @Length(min = 1, max = 32, message = "安全码必须在{min}~{max}字符之间")
    private String salt;

    @ApiModelProperty(value = "用户头像")
    @NotBlank(message = "用户头像不能为空")
    @Length(min = 1, max = 255, message = "用户头像必须在{min}~{max}字符之间")
    private String head;

    @NotBlank(message = "交易密码不能为空")
    @Length(min = 1, max = 32, message = "交易密码必须在{min}~{max}字符之间")
    private String tradePwd;

    @ApiModelProperty(value = "推送id")
    @NotBlank(message = "推送id不能为空")
    @Length(min = 1, max = 50, message = "推送id必须在{min}~{max}字符之间")
    private String pushId;

    @ApiModelProperty(value = "授信额度")
    private BigDecimal creditPrice;

    @ApiModelProperty(value = "最后登录时间")
    private Date lastTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "创建人")
    @NotNull(message = "创建人不能为空")
    private Long createUserId;

    @ApiModelProperty(value = "数据版本")
    @NotNull(message = "数据版本不能为空")
    private Integer version;

    private String token;

    @NotNull(message = "商户id")
    private Long storeId;

    @ApiModelProperty(value = "商户类型(seller 批发商，buyer 进货商，all 批发商/进行商一体）")
    @NotNull(message = "商户类型不能为空")
    private StoreType storeType;

    @ApiModelProperty(value = "商户状态( create|新商户，follow|跟进中， wait|等待审核，success|申请成功,failure|申请失败)")
    private StoreStatus status;

    @ApiModelProperty(value = "状态节点")
    private StoreStatusNode statusNote;
    /**
     * 是否设置交易密码
     */
    @ApiModelProperty(value = "是否设置交易密码")
    private boolean isSetTradePwd;
    /**
     * APP 配置对象
     */
    private AppConfigVo appConfigVo;
    /**
     * 客服电话
     */
    private String servicePhone;
}
